package com.etcsoft.examples.binding.viewer.tree;

import org.eclipse.core.databinding.observable.list.WritableList;
import org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;

import com.etcsoft.examples.binding.viewer.FileObservaleFactory;
import com.etcsoft.examples.binding.viewer.FileTreeStructureAdvisor;

public class TreeView extends ViewPart {
    private WritableList data;
    private TreeViewer treeViewer;

    public TreeView() {
    }

    @Override
    public void createPartControl(Composite parent) {
        parent.setLayout(new FillLayout(SWT.HORIZONTAL));

        treeViewer = new TreeViewer(parent, SWT.BORDER);
        treeViewer.setContentProvider(new ObservableListTreeContentProvider(
                new FileObservaleFactory(), new FileTreeStructureAdvisor()));
    }

    @Override
    public void setFocus() {
        // TODO Auto-generated method stub

    }

}
